﻿<%@ page title="" language="C#" masterpagefile="~/Training.master" autoeventwireup="true" inherits="Training.Web.Lists.Administration.Catalog.InqueryPembicaraList, App_Web_tml0wt00" %>

<asp:Content ID="ctnBody" ContentPlaceHolderID="body" runat="server">
    <link type="text/css" rel="stylesheet" href="<%= ResolveUrl("~/styles/ui.jqgrid.css") %>" />
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/i18n/grid.locale-id.js") %>"></script>
    <script type="text/javascript" src="<%= ResolveUrl("~/scripts/jquery.jqGrid.min.js") %>"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.msgBox.v1.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/chosen/chosen.jquery.min.js") %>" type="text/javascript"></script>
    <link href="<%= ResolveUrl("~/styles/chosen/chosen.min.css") %>" rel="stylesheet"
        type="text/css" />
    <div>
        <table border="0">
            <tr>
                <td>
                    Pembicara
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:DropDownList ID="ddlPembicara" runat="server" Width="300">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr id="Tr1" runat="server" visible="false">
                <td colspan="3">
                    <div style="text-align: right; padding-top: 10px;">
                        <button id="btnProcess" type="button">
                            Proses</button>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <br />
    <div style="overflow: auto; height: 350px;">
        <table id="table" class="scroll" cellpadding="0" cellspacing="0">
        </table>
        <div id="pager" class="scroll">
        </div>
        <br />
        <div id="dialog" title="Default dialog">
        </div>
    </div>
    <script type="text/javascript">

        $(document).ready(function () {
            $('#<%= ddlPembicara.ClientID %>').chosen({ placeholder_text_single: "-- pilih pembicara --" });

            $('#<%= ddlPembicara.ClientID %>').change(function () {
                var pembicaraID = $('#<%= ddlPembicara.ClientID  %> option:selected').val();
                if (pembicaraID == "")
                    pembicaraID = 0;

                var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Administration/Catalog/Pelatihanhandler.ashx") %>';
                $("#table").jqGrid('setGridParam', { url: handlerUrl + '?method=getdatabypembicara&pembicaraID=' + pembicaraID });
                $("#table").trigger("reloadGrid");
            });

        });
    </script>
    <script type="text/javascript">
        $("#btnProcess").click(function () {
            var pembicaraID = $('#<%= ddlPembicara.ClientID  %> option:selected').val();
            if (pembicaraID == "")
                pembicaraID = 0;
           
            var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Administration/Catalog/Pelatihanhandler.ashx") %>';
            $("#table").jqGrid('setGridParam', { url: handlerUrl + '?method=getdatabypembicara&pembicaraID=' + pembicaraID });
            $("#table").trigger("reloadGrid");
        });
    </script>
    <script type="text/javascript">
        $("#btnProcess").button({ icons: { primary: "ui-icon-search"} });
    </script>
    <script type="text/javascript">

        var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Administration/Catalog/Pelatihanhandler.ashx") %>';

        var pembicaraID = $('#<%= ddlPembicara.ClientID  %> option:selected').val();

        if (pembicaraID == "")
            pembicaraID = 0;

        $('#table').jqGrid({
            url: handlerUrl + '?method=getdatabypembicara' + '&pembicaraID=' + pembicaraID,
            datatype: 'json',
            colNames: ['ID', 'Tgl. Mulai','Tgl. Akhir', 'Nama Pelatihan', 'Tempat Pelatihan'],
            colModel: [
                { name: 'PelatihanID', key: true, hidden: true, index: 'PelatihanID', width: 60 },
                { name: 'TglPelatihan', index: 'TglPelatihan', align: 'center', width: 100, search: false, formatter: 'date', formatoptions: { newformat: 'd M Y'} },
                { name: 'TglAkhirPelatihan', index: 'TglAkhirPelatihan', align: 'center', width: 100, search: false, formatter: 'date', formatoptions: { newformat: 'd M Y'} },
                { name: 'NamaPelatihan', index: 'NamaPelatihan', align: 'left', width: 200, searchoptions: { sopt: ['cn', 'eq']} },
                { name: 'TempatPelatihan', index: 'TempatPelatihan', align: 'left', width: 200, searchoptions: { sopt: ['cn', 'eq']} }

           	],
            rownumbers: true,
            rowNum: 10,
            id: 'PelatihanID',
            multiselect: false,
            rowList: [5, 10, 15, 20],
            pager: '#pager',
            sortname: 'NamaPelatihan',
            sortorder: "asc",
            viewrecords: true,
            jsonReader: { repeatitems: false },
            width: 800,
            height: '100%',
            caption: 'Pelatihan',
            ajaxGridOptions: { cache: false }
        });

        $("#table").jqGrid('navGrid', '#pager', { edit: false, add: false, del: false, searchtext: 'Search', refreshtext: 'Refresh' },
        {}, {}, {}, { closeOnEscape: true, multipleSearch: true, closeAfterSearch: true });

       
    
    </script>
</asp:Content>
